//1.函数作为参数时
function foo(){

}

function bar(fn:() => void){
  fn()
}
bar(foo)

//2.定义常量时，编写函数的类型
type typeAddFn = (num1:number,num2:number) => number
const add: typeAddFn = (num1:number,num2:number) => {
  return num1+num2
}
export{}